コード例 #1
0
ファイル: BaseBoat.cs プロジェクト: LimSiHwan/4realzetSki
    public void ChangeState(string stateName)
    {
        System.Type t = System.Type.GetType(stateName);

        baseBoatState.Destruct();
        baseBoatState = gameObject.AddComponent(t) as BaseBoatState;
        baseBoatState.Construct();
    }
コード例 #2
0
ファイル: BaseBoat.cs プロジェクト: LimSiHwan/4realzetSki
 protected virtual void Start()
 {
     BackChk  = false;
     boatGear = BoatGear.N;
     //controller = gameObject.AddComponent<CharacterController>();
     rbody         = gameObject.GetComponent <Rigidbody>();
     thisTransform = gameObject.GetComponent <Transform>();
     tempTransform = thisTransform.transform.position;
     baseBoatState = gameObject.AddComponent <DrivingBoatState>();
     baseBoatState.Construct();
     boxCol = gameObject.GetComponent <BoxCollider>();
 }