ShanxiKnowledgeBase/SXElectricityFaultA&E/Assets/Ladder.cs

37 lines
689 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Ladder : MonoBehaviour
{
public static Ladder instance;
SkinnedMeshRenderer smr;
float weight;
bool show = false;
public void Awake()
{
instance = this;
}
public void Init()
{
smr = transform.GetComponent<SkinnedMeshRenderer>();
show = true;
}
public void closed()
{
show = false;
}
void Update()
{
if (show == false)
return;
if (weight < 100f)
{
weight += 1.8f;
smr.SetBlendShapeWeight(0, weight);
Debug.Log(show);
}
}
}