43 lines
847 B
C#
Raw Normal View History

2022-03-15 10:37:34 +08:00
using DG.Tweening;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
2022-03-15 10:37:34 +08:00
public class Tree : Interactable
{
2022-03-15 10:37:34 +08:00
int interactState = 0;
public float rotateDuration=0.5f;
SpriteRenderer m_spr;
public Sprite sprite_Mu;
void Start()
{
2022-03-15 10:37:34 +08:00
m_spr = GetComponent<SpriteRenderer>();
}
// Update is called once per frame
void Update()
{
2022-03-15 10:37:34 +08:00
}
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;
}
}
}