43 lines
847 B
C#
43 lines
847 B
C#
using DG.Tweening;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Tree : Interactable
|
|
{
|
|
int interactState = 0;
|
|
public float rotateDuration=0.5f;
|
|
SpriteRenderer m_spr;
|
|
public Sprite sprite_Mu;
|
|
void Start()
|
|
{
|
|
m_spr = GetComponent<SpriteRenderer>();
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
public override void OnCall()
|
|
{
|
|
switch (interactState) {
|
|
case 0:
|
|
transform.DORotate(new Vector3(0, 0, -90), rotateDuration);
|
|
interactState++;
|
|
break;
|
|
case 1:
|
|
m_spr.sprite = sprite_Mu;
|
|
interactState++;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|