Ejemplo n.º 1
0
 void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
     play.onClick.AddListener(OnPlay);
     quit.onClick.AddListener(OnQuit);
     HideGameOver();
 }
        public override void _Ready()
        {
            Health      = 100;
            DeathSignal = nameof(MainCharacterDie);

            Input.SetMouseMode(Input.MouseMode.Captured);
            this.animationPlayer  = GetNode <AnimationPlayer>("Player");
            this.collisionShape   = GetNode <CollisionShape>("CollisionShape");
            this.uiGameOver       = GetNode <UiGameOver>("UIGameOver");
            this.canvasLayer      = GetNode <CanvasLayer>("CanvasLayer");
            this.rayCast          = GetNode <RayCast>("RotationHelper/RayCast");
            this.camera           = GetNode <Camera>("RotationHelper/Camera");
            this.rotationHelper   = GetNode <Spatial>("RotationHelper");
            this.spotLight        = GetNode <SpotLight>("RotationHelper/SpotLight");
            this.labelMainMessage = GetNode <MessageLabel>("CanvasLayer/Label");
        }