示例#1
0
    /// <summary>
    ///   Change to next Hero.
    /// </summary>
    public static void ChangeHero()
    {
        HeroStrong heroStrong = InputManager.Instance.heroStrong;
        HeroFast   heroFast   = InputManager.Instance.heroFast;

        Hero hero = GetActiveHero();

        if (hero == null)
        {
            DisableControlAll();
            lastActiveHero._OnFocus();
        }
        else if (hero.Equals(heroStrong))
        {
            heroStrong._OnFocusOut();
            heroFast._OnFocus();
            lastActiveHero = heroFast;
        }
        else if (hero.Equals(heroFast))
        {
            heroFast._OnFocusOut();
            heroStrong._OnFocus();
            lastActiveHero = heroStrong;
        }
        else
        {
            DisableControlAll();
            heroStrong._OnFocus();
            lastActiveHero = heroStrong;
        }
        SoundManager.Instance.SendMessage("PlaySFXSwap");
    }
示例#2
0
 void Start()
 {
     heroStrong       = FindObjectOfType <HeroStrong>();
     heroFast         = FindObjectOfType <HeroFast> ();
     dialog           = GetComponentInChildren <Dialog> ();
     cameraController = FindObjectOfType <CameraController> ();
 }
 void Awake ()
 {
     heroStrong = FindObjectOfType<HeroStrong>();
     heroFast = FindObjectOfType<HeroFast>();
     SelectionBoxCurrent = SelectionBox1;
     defaultColor = SelectionBox1.GetComponent<Renderer>().material.color;
     colorsPuzzle = this.GetComponent<ColorsPuzzle>();
 }
示例#4
0
 void Start()
 {
     instance          = this;
     heroStrong        = FindObjectOfType <HeroStrong>();
     heroFast          = FindObjectOfType <HeroFast>();
     heroStrongControl = heroStrong.GetComponent <HeroControl>();
     heroFastControl   = heroFast.GetComponent <HeroControl>();
 }
示例#5
0
 void Awake()
 {
     heroStrong          = FindObjectOfType <HeroStrong>();
     heroFast            = FindObjectOfType <HeroFast>();
     SelectionBoxCurrent = SelectionBox1;
     defaultColor        = SelectionBox1.GetComponent <Renderer>().material.color;
     colorsPuzzle        = this.GetComponent <ColorsPuzzle>();
 }
示例#6
0
 void Awake () {
     controller = GetComponentInParent<ClawController>();
     coll = GetComponent<Collider2D>();
     clawInitialPos = coll.bounds.center;
     heroStrong = FindObjectOfType<HeroStrong> ();
     heroFast = FindObjectOfType<HeroFast> ();
     heroStrongRigidBody = heroStrong.GetComponent<Rigidbody2D>();
     heroFastRigidBody = heroFast.GetComponent<Rigidbody2D>();
 }
示例#7
0
 void Awake() {
     clawMechanism = GetComponentInChildren<ClawMechanism>();
     clawNode = GetComponentInChildren<ClawNode>();
     clawPerSe = GetComponentInChildren<ClawPerSe>();
     heroStrong = FindObjectOfType<HeroStrong> ();
     heroFast = FindObjectOfType<HeroFast>();
     Terminal = GetComponentInChildren<InvisibleAreaTrigger>();
     clawLastPosition = clawNode.GetComponent<Renderer>().bounds.center;
     cameraControl = FindObjectOfType<CameraController>();
 }
示例#8
0
 void Awake()
 {
     controller          = GetComponentInParent <ClawController>();
     coll                = GetComponent <Collider2D>();
     clawInitialPos      = coll.bounds.center;
     heroStrong          = FindObjectOfType <HeroStrong> ();
     heroFast            = FindObjectOfType <HeroFast> ();
     heroStrongRigidBody = heroStrong.GetComponent <Rigidbody2D>();
     heroFastRigidBody   = heroFast.GetComponent <Rigidbody2D>();
 }
示例#9
0
 void Awake()
 {
     clawMechanism    = GetComponentInChildren <ClawMechanism>();
     clawNode         = GetComponentInChildren <ClawNode>();
     clawPerSe        = GetComponentInChildren <ClawPerSe>();
     heroStrong       = FindObjectOfType <HeroStrong> ();
     heroFast         = FindObjectOfType <HeroFast>();
     Terminal         = GetComponentInChildren <InvisibleAreaTrigger>();
     clawLastPosition = clawNode.GetComponent <Renderer>().bounds.center;
     cameraControl    = FindObjectOfType <CameraController>();
 }
示例#10
0
 void Awake()
 {
     heroStrong = FindObjectOfType<HeroStrong>();
     heroFast = FindObjectOfType<HeroFast>();
     puzzleController = this.GetComponent<PuzzleController>();
 }
示例#11
0
 void Awake()
 {
     heroStrong       = FindObjectOfType <HeroStrong>();
     heroFast         = FindObjectOfType <HeroFast>();
     puzzleController = this.GetComponent <PuzzleController>();
 }
示例#12
0
 void Start()
 {
     heroStrong = FindObjectOfType<HeroStrong>();
     heroFast = FindObjectOfType<HeroFast> ();
     dialog = GetComponentInChildren<Dialog> ();
     cameraController = FindObjectOfType<CameraController> ();
 }
示例#13
0
 void Start()
 {
     instance   = this;
     heroStrong = FindObjectOfType <HeroStrong>();
     heroFast   = FindObjectOfType <HeroFast>();
 }