Пример #1
0
 void Awake()
 {
     range = 30f;
     playerControl = gameObject.GetComponent<HeroController> ();
     player = GameObject.FindGameObjectWithTag ("Player");
     presscount = 0;
     magneteffect = true;
 }
Пример #2
0
    void Start()
    {
        this.HeroController = this.GetComponent<HeroController>();

        JollyDebug.Watch (this, "FacingRight", delegate ()
        {
            return this.FacingRight;
        });
    }
Пример #3
0
    // Update is called once per frame
    void Update()
    {
        Debug.Log("check restart");

        if (controller == null)
            controller = this.GetComponent<HeroController>();

        if(controller.Fire)
        {
            Application.LoadLevel(Application.loadedLevel);
        }
    }
Пример #4
0
    /// <summary>
    /// Create new instance of hero (get from pool).
    /// </summary>
    private HeroController InstantiateHero()
    {
        GameObject go = ObjectPool.instance.GetObject(_model.Hero.PrefabName);
        Transform  t  = go.transform;

        t.position   = heroSpawnPoint.position;
        t.rotation   = heroSpawnPoint.rotation;
        t.localScale = Vector3.one;
        go.SetActive(true);
        HeroController hero = go.GetComponent <HeroController>();

        return(hero);
    }
Пример #5
0
        private void OnHeroControllerStart(On.HeroController.orig_Start orig, HeroController self)
        {
            orig(self);
            if (changed)
            {
                return;
            }
            changed = true;

            self.StartCoroutine(addCharmStates(self));

            changed = true;
        }
Пример #6
0
    public override bool Init(object context)
    {
        base.Init(context);
        _heroCtrl = context as HeroController;
        if (_heroCtrl == null)
        {
            return(false);
        }

        _ghostEffect = _heroCtrl.ghostEffect;
        coldDownTime = _heroCtrl.Config.SprintColdDownTime;
        return(true);
    }
    public void UpdateUnitFrame(HeroController hero)
    {
        // Gather Data
        int currentHealth = hero.GetCurrentHealth();
        int maxHealth     = hero.GetMaxHealth();
        int currentLevel  = hero.GetCurrentLevel();

        // Perform Logik on thaz Data!
        float fillAmount = (float)currentHealth / (float)maxHealth;

        levelText.text       = currentLevel.ToString();
        healthbar.fillAmount = fillAmount;
    }
Пример #8
0
        private static IEnumerator StartRecoil
        (
            On.HeroController.orig_StartRecoil orig,
            HeroController self,
            CollisionSide impactside,
            bool spawndamageeffect,
            int damageamount
        )
        {
            self.takeHitDoublePrefab.GetComponent <AudioSource>().volume = Mathf.Clamp(Volume * DoubleDamageVolumeModifier, 0, 1);

            yield return(orig(self, impactside, spawndamageeffect, damageamount));
        }
Пример #9
0
        public IEnumerator AttackHandlerInit()
        {
            while (HeroController.instance == null)
            {
                yield return(null);
            }

            hc_instance        = HeroController.instance;
            h_state            = HeroController.instance.cState;
            knight             = HeroController.instance.GetAttr <Rigidbody2D>("rb2d");
            damageNumberTestGO = new GameObject("damageNumberTESTCLONE", typeof(Text), typeof(CanvasRenderer), typeof(RectTransform));
            DontDestroyOnLoad(damageNumberTestGO);
        }
Пример #10
0
 public void ReStart(bool firstStart = false)
 {
     overGame = false;
     stepHero = new List <Vector3>();
     aniHero  = new List <StatusHero>();
     SetNearFarPoint();
     myHero     = Modules.mainCharacter.GetComponent <HeroController>();
     detalPoint = Modules.mainCharacter.transform.position - transform.position;
     if (!firstStart)
     {
         CallAniNew(aniRun, StatusHero.run, true, 1, Modules.moreSpeedAni, Modules.maxSpeedAni);
     }
 }
Пример #11
0
 void Start()
 {
     this.HeroController = this.GetComponent <HeroController>();
     //this.GetComponentInChildren<SpriteRenderer>().sprite = this.BodySprites[this.HeroController.PlayerNumber];
     //this.ProjectileSprite = this.ProjectileSprites[this.HeroController.PlayerNumber];
     //this.ProjectileExplosionSprite = this.ProjectileExplosions[this.HeroController.PlayerNumber];
     this.StartScale            = this.scale;
     this.StartWidth            = this.GetComponent <Collider2D>().bounds.size.x;
     this.RespawnTimeCalculated = this.RespawnTime;
     OriginalMaxSpeed           = MaxNewSpeed;
     health          = maxHealth;
     this.groundMask = LayerMask.NameToLayer("Ground");
 }
Пример #12
0
    // Use this for initialization
    void Start()
    {
        GameObject go;

        go     = GameObject.Find("GUI Manager/HeroBotBar");
        botBar = go.GetComponent <BottomBar>();

        controller       = this.GetComponent <HeroController>();
        playerStatus     = this.GetComponent <PlayerStatus>();
        animationManager = this.GetComponent <AnimationManager>();

        UpdatePassiveStatus();
    }
Пример #13
0
    private void CreateHero(int playSel, int playNum)
    {
        GameObject     hero           = Instantiate(heroModels[playSel], baseHeroesPositions[playNum].position, baseHeroesPositions[playNum].rotation, heroes);
        HeroController heroController = hero.GetComponent <HeroController>();

        heroController.playerNumber = playNum;
        hero.transform.Find("Circle").GetComponent <Circle_chara>().color = CommonProperties.Instance._colors[playNum];

        foreach (Renderer r in hero.transform.Find("perso").GetComponentsInChildren <Renderer>())
        {
            r.material.mainTextureScale = new Vector2(tints[playSel * 4 + playNum], tints[playSel * 4 + playNum]);
        }
    }
Пример #14
0
 private void Awake()
 {
     _rb                 = gameObject.GetComponent <Rigidbody2D>();
     _sr                 = gameObject.GetComponent <SpriteRenderer>();
     _dmg                = gameObject.AddComponent <DamageHero>();
     _bc                 = gameObject.GetComponent <BoxCollider2D>();
     _rc                 = gameObject.AddComponent <Recoil>();
     _hm                 = gameObject.GetComponent <HealthManager>();
     _aud                = gameObject.AddComponent <AudioSource>();
     _anim               = gameObject.GetComponent <Animator>();
     _hitEffects         = gameObject.AddComponent <EnemyHitEffectsUninfected>();
     _hitEffects.enabled = true;
     _target             = HeroController.instance;
 }
Пример #15
0
        public void DB_CreatesNewEntries_Collection()
        {
            HeroController controller = new HeroController(db);
            Hero           testHero   = new Hero
            {
                Name   = "Mario",
                Weapon = "Fire_Flower"
            };

            controller.Create(testHero, null);
            var collection = (controller.Index() as ViewResult).ViewData.Model as List <Hero>;

            CollectionAssert.Contains(collection, testHero);
        }
Пример #16
0
 public LevelData(int cNumber, HeroController player, List <DropClass> drops, History history, GameStatistics gStats,
                  List <EnemyData> _enInfo, List <InterObjData> _intInfo, List <NPCData> _npcInfo)
 {
     active           = true;
     checkpointNumber = cNumber;
     qInfo            = new QuestInfo(history.ActiveQuests);
     sInfo            = new StoryInfo(history);
     lStatsInfo       = new LevelStatsData(gStats);
     eInfo            = new EquipmentInfo(player.CurrentWeapon, player.Bag);
     dropInfo         = new DropData(drops);
     enInfo           = _enInfo;
     intInfo          = _intInfo;
     npcInfo          = _npcInfo;
 }
Пример #17
0
        private void HeroControllerOnStart(On.HeroController.orig_Start orig, HeroController self)
        {
            // Execute original method
            orig(self);

            RegisterDreamShieldEvents();

            // Create the prefab if we haven't already, we can only do this once the local player is initialized
            if (!_isPrefabCreated)
            {
                CreateDreamshieldPrefab();
                _isPrefabCreated = true;
            }
        }
Пример #18
0
    void Start()
    {
        liquidationExpGameObject = GameObject.Find("LiquidationExp");
        liquidationExp           = liquidationExpGameObject.GetComponent <LiquidationExp>();
        hero            = GameObject.Find("Hero");
        heroController  = hero.GetComponent <HeroController>();
        worldController = GameObject.Find("世界の仕組みそのもの").GetComponent <WorldController>();
        // oracle = worldController.oracle;

        firstDay      = worldController.date;
        completionDay = firstDay + requiredDays;
        one2          = true;
        completed     = false;
    }
Пример #19
0
        public InitGame(ControllersStorage controllers, GameModel model,
                        IPlayerInput playerInput)
        {
            ViewsFabric viewsFabric = new ViewsFabric();


            IActionSystem actionsController = InitActions(controllers);

            HeroController hero = InitializeCameraAndPlayer(viewsFabric,
                                                            controllers, model, playerInput, actionsController);

            InitializeChests(controllers, model);
            InitializePirates(controllers, model, actionsController, hero);
        }
Пример #20
0
    // Use this for initialization
    void Start()
    {
        enableWindow       = false;
        defaultScreenRes.x = 1920;                                  //declare max screen ratio
        defaultScreenRes.y = 1080;                                  //declare max screen ratio

        GameObject go = GameObject.FindGameObjectWithTag("Player"); //Find player

        controller = go.GetComponent <HeroController>();

        questData   = GameObject.Find("QuestData").GetComponent <Quest_Data>();
        itemData    = GameObject.Find("Item_Data").GetComponent <Item_Data>();
        monsterData = GameObject.Find("MonsterData").GetComponent <Monster_Data>();
    }
Пример #21
0
    void OnCollisionEnter(Collision collision)
    {
        if (collision.collider.tag == "Hero")
        {
            HeroController        hero    = collision.collider.GetComponent <HeroController>();
            Pb.ChangeWorldRequest request = new Pb.ChangeWorldRequest();
            request.Pid      = hero._heroID;
            request.SrcId    = GameConfig._desertSceneID;
            request.TargetId = GameConfig._roomSceneID;

            byte[] message = request.ToByteArray();
            NetworkHandler.Instance.SendMessage(Protocol.GAME_MSG_CHANGE_WORLD, message);
        }
    }
    // Use this for initialization
    void Start()
    {
        Screen.SetResolution(1024, 600, true);
        switch (scenenum)
        {
        case 1:
            break;

        case 2:
            targetGameobject.transform.position = new Vector3(-174.0f, 0.71f, 0);
            break;

        case 3:
            targetGameobject.transform.position = new Vector3(-160.3f, -0.005751047f, 0);
            this.transform.position             = new Vector3(-157.16f, 0.98f, -10);
            break;

        case 4:
            targetGameobject.transform.position = new Vector3(-135.1258f, -0.2255612f, 0);
            this.transform.position             = new Vector3(-132.09f, 0.98f, -10);
            break;

        case 5:
            targetGameobject.transform.position = new Vector3(-126.4367f, -4.628854f, 0);
            this.transform.position             = new Vector3(-123.26f, -4.12f, -10);
            break;
        }

        if (SceneManager.GetActiveScene().name == "Mission1BossFight")
        {
            whichscene = 99;
            HeroIn();
        }
        else
        {
            whichscene = 1;
        }
        showtishi     = false;
        showtishitext = "";
        if (targetGameobject.transform.position.x < -190.0f)
        {
            HeroIn();
        }


        target_script = targetGameobject.GetComponent <HeroController> ();

        lockCamera = false;
    }
Пример #23
0
    public override void OnInspectorGUI()
    {
        HeroController controller = (HeroController)target;

        controller.heroImage = (Texture2D)EditorGUILayout.ObjectField("Hero Image", controller.heroImage, typeof(Texture2D), true);


        controller.classType = (ClassType)EditorGUILayout.EnumPopup("Class", controller.classType);

        EditorGUILayout.Space();

        controller.sizeMesh = EditorGUILayout.IntField("Size Mesh", controller.sizeMesh);

        while (controller.sizeMesh != controller.modelMesh.Count)
        {
            if (controller.sizeMesh > controller.modelMesh.Count)
            {
                controller.modelMesh.Add(null);
            }
            else
            {
                controller.modelMesh.RemoveAt(controller.modelMesh.Count - 1);
            }
        }
        EditorGUI.indentLevel++;

        for (int i = 0; i < controller.modelMesh.Count; i++)
        {
            controller.modelMesh[i] = (GameObject)EditorGUILayout.ObjectField("Model Mesh" + (i + 1).ToString(), controller.modelMesh[i], typeof(GameObject), true);
        }

        EditorGUI.indentLevel--;

        EditorGUILayout.Space();


        controller.colorTakeDamage = EditorGUILayout.ColorField("Take Attack Color", controller.colorTakeDamage);

        EditorGUILayout.Space();

        controller.autoAttack = EditorGUILayout.Toggle("Auto Attack", controller.autoAttack);

        EditorGUILayout.Space();

        if (GUI.changed)
        {
            EditorUtility.SetDirty(controller);
        }
    }
Пример #24
0
        private void OnTakeDamage(On.HeroController.orig_TakeDamage orig, HeroController hc, GameObject go,
                                  CollisionSide damageSide, int damageAmount, int hazardType)
        {
            int old_health = PlayerData.instance.health;

            orig(hc, go, damageSide, damageAmount, hazardType);

            // OnTakeDamage is called even when the player has iframes.
            // And it is called a LOT, so to avoid spamming the server, we check if the health changed before sending.
            if (PlayerData.instance.health != old_health)
            {
                Log("Took Damage: " + PlayerData.instance.health + " " + PlayerData.instance.maxHealth);
                ClientSend.HealthUpdated(PlayerData.instance.health, PlayerData.instance.maxHealth, PlayerData.instance.healthBlue);
            }
        }
Пример #25
0
 private void Update()
 {
     if (GameObject.FindGameObjectWithTag("Player"))
     {
         if (Vector3.Distance(transform.position, _hero.transform.position) <= _paramsReceive.GetDistance())
         {
             CurrentState = EnemyState.ATTACK;
         }
     }
     else
     {
         _hero = null;
     }
     coolDown += Time.deltaTime;
 }
Пример #26
0
    override public void Init()
    {
        try { controller = target_status.GetComponent <HeroController>(); }
        catch { Debug.Log("statusがセットされていないか、存在していません。また、ヒーローコントローラーが存在しない可能性もあります。"); }


        manager = target_status.GetComponent <HeroManager>();

        if (manager)
        {
            manager.ShotAnimation(HeroManager.HeroAnimState.freeze);
        }

        buff_time_sec = 2.0f;
    }
Пример #27
0
        private void FixHero(HeroController hc)
        {
            if (hc == null)
            {
                return;
            }

            // Return control to the game, reset rotation
            hc.AffectedByGravity(true);
            hc.RegainControl();
            hc.GetComponent <HeroAnimationController>().StartControl();
            hc.gameObject.transform.rotation = Quaternion.identity;

            _wallRunning = false;
        }
Пример #28
0
        private static bool CanQuickMap(On.HeroController.orig_CanQuickMap orig, HeroController self)
        {
            HeroControllerStates cs = self.cState;

            return(Storage
                ? !GameManager.instance.isPaused &&
                   !cs.onConveyor &&
                   !cs.dashing &&
                   !cs.backDashing &&
                   (!cs.attacking || ReflectionHelper.GetAttr <HeroController, float>(self, "attack_time") >= self.ATTACK_RECOVERY_TIME) &&
                   !cs.recoiling &&
                   !cs.hazardDeath &&
                   !cs.hazardRespawning
                : orig(self));
        }
Пример #29
0
    void Start()
    {
        //par2 = particleposition.transform.position;

        player =  GameObject.FindGameObjectWithTag("Player").GetComponent<HeroController>();
        //particle = gameObject.GetComponent<ParticleSystem > ();
        light = gameObject.GetComponent<Light> ();
        line = gameObject .GetComponent<LineRenderer > ();
        line.enabled = true;
        light.enabled = true;
        /*Ray2D ray = new Ray2D (transform.position, transform.right);
        RaycastHit2D hit;
        line.SetPosition (0, ray.origin);
        line.SetPosition (1, ray.GetPoint (10));*/
    }
Пример #30
0
 // Update is called once per frame
 void Update()
 {
     if (hero != null)
     {
         HeroController hCtrl = hero.GetComponent <HeroController> ();
         if (hCtrl.EnableMovement)
         {
             cr.SetAlpha(0.0f);
         }
         else
         {
             cr.SetAlpha(1.0f);
         }
     }
 }
Пример #31
0
        public void FSMInitialization(Transform enemy, Transform moveDirection, HeroController heroController, IComboRegistration combosRegistration)
        {
            m_Character           = transform;
            m_CharacterController = GetComponent <CharacterController>();
            m_Animator            = GetComponent <Animator>();
            m_HeroController      = heroController;
            m_CombosRegistration  = combosRegistration;

            foreach (var cur in statesList)
            {
                cur.StateInitialization(enemy, moveDirection, m_Character, m_CharacterController, m_Animator, this, m_HeroController, combosRegistration);
            }
            currentState = this[initState];
            currentState.EnterState(m_MoveDirection);
        }
        private void MovePlayer(string command)
        {
            if (HeroController == null || EnemyController == null || MapController == null)
            {
                return;
            }

            Point newCoordinate = HeroController.GetNextCoordinate(command);

            if (MapController.CanMove(newCoordinate))
            {
                if (MapController.SameRoom(HeroController.Player.Coordinate, EnemyController.Character.Coordinate))
                {
                    HeroController.RemoveHealth();
                    Console.WriteLine("You lost 1 health. Now you has " + HeroController.Player.Health + " left.");
                }

                HeroController.Move(newCoordinate);
                if (EnemyController.CanMove())
                {
                    var nextEnemyMove = MapController.GetNextEnemyCoordinate(newCoordinate, EnemyController.Character.Coordinate);
                    EnemyController.Move(nextEnemyMove);
                }

                MapController.Print(HeroController.Player.Coordinate, EnemyController.Character.Coordinate);

                if (MapController.NextRoom(HeroController.Player.Coordinate, EnemyController.Character.Coordinate))
                {
                    Console.WriteLine("The enemy is close to you!");
                }
                else if (MapController.SameRoom(HeroController.Player.Coordinate, EnemyController.Character.Coordinate))
                {
                    if (HeroController.Player.Bag.Items.Count > 0 && HeroController.Player.Bag.Items[0].Type == Item.ItemType.Sword)
                    {
                        EnemyController.Dead = true;
                        Console.WriteLine("You killed the enemy with the Sword. You are free to go.");
                    }
                    else
                    {
                        Console.WriteLine("The enemy is in front of you. You have no Sword, RUN!.");
                    }
                }
            }
            else
            {
                Console.WriteLine("There is a wall here!");
            }
        }
Пример #33
0
    /// <summary>
    /// 光标移动后的update
    /// </summary>
    private void CursorUpdate()
    {
        //当前mapNode是否有hero
        if (GetMapNode(cursorIdx).locatedHero)
        {
            //判断当前是否有选择hero
            if (curHero == null)
            {
                //鼠标进入hero
                curMouseHero = GetMapNode(cursorIdx).locatedHero;
                curMouseHero.Moved(true);
                if (mouseCursor.activeSelf)
                {
                    cursorAnimator.SetBool("Hero", true);
                }
            }
        }
        else
        {
            //鼠标移出hero
            if (curMouseHero != null)
            {
                curMouseHero.Moved(false);
                curMouseHero = null;
            }
            if (mouseCursor.activeSelf)
            {
                cursorAnimator.SetBool("Hero", false);
            }
        }

        //当前块是否有ennemy
        if (GetMapNode(cursorIdx).locatedEnemy)
        {
            //鼠标进入enemy
            curMouseEnemy = GetMapNode(cursorIdx).locatedEnemy;
            curMouseEnemy.Moved(true);
        }
        else
        {
            //鼠标移出enemy
            if (curMouseEnemy != null)
            {
                curMouseEnemy.Moved(false);
                curMouseEnemy = null;
            }
        }
    }
        private static void KillDiagonals(On.HeroController.orig_HeroDash orig, HeroController self)
        {
            InputHandler input = ReflectionHelper.GetAttr <HeroController, InputHandler>(HeroController.instance, "inputHandler");

            if (input.inputActions.left.IsPressed || input.inputActions.right.IsPressed)
            {
                ref bool downEnabled = ref Mirror.GetFieldRef <OneAxisInputControl, bool>(input.inputActions.down, "Enabled");

                bool origEnabled = downEnabled;

                downEnabled = false;

                orig(self);

                downEnabled = origEnabled;
            }
Пример #35
0
    protected override void Start()
    {
        mAnimCtl = this.gameObject.AddComponent<HeroController>();
        bindModel();
        mapEvents();

        //TODO: 测试代码,选人的时候直接调用下面的dispatch即可
        if (this.getUtil().SelectedHeroName == null)
        {
            //默认选人
            delayCall(1, delegate (object d)
            {
                dispatch(Events.EVENT_SELECT_HERO, Constants.HERO_NAME_JINGCHA);
            }, null);
        }
    }
Пример #36
0
//	UIController m_uiController;

	// Use this for initialization
	void Start () 
	{
		ResetInterval(); //Set up initial interval information

//		m_uiController = GameContext.currentInstance.uiController;
//		_actionQueue = new Queue<EntityWrapper> ();
		_actionQueue = new Queue<ActionType> ();
		_enemyActionQueue = new Queue<ActionType> ();

		_HeroMain = FindObjectOfType<HeroController> ();

		if (_HeroMain != null) 
		{
			_combatIntervalHero = _HeroMain._attackRate;
		} 
		else 
		{
			Debug.LogWarning("No HeroController found for CombatController to work with");
		}

		// TEST ONLY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
		// TODO: Remove Test Cases
//		m_currentTestPlayerEntity = _TestplayerGo.GetComponent<EntityMain> ();
//		m_currentTestEnemyEntity = _TestenemyGo.GetComponent<EntityMain> ();
//		m_currentTestAction = _TestActionGo.GetComponent<ActionType> ();
//		
//
//		if (m_currentTestPlayerEntity != null && m_currentTestEnemyEntity != null && m_currentTestAction != null) 
//		{
//			_actionList = new List<EntityWrapper> ();
//
//			for (int i = 0; i < 3; i++) 
//			{
//				EntityWrapper newItem = new EntityWrapper( m_currentTestPlayerEntity, m_currentTestAction );
//				_actionList.Add(newItem);
//			}
//		} 
//		else 
//		{
//			Debug.LogWarning("There are no entities to Test with");
//		}

		// TEST END ////////////////////////////////////////////////////
	}
Пример #37
0
    IEnumerator handleConfigureSession(WWW _www)
    {
        yield return _www;

        if (_www.text == "cat1")
        {
            currentCat = player1;
            otherCat = player2;
        }
        else
        {
            currentCat = player2;
            otherCat = player1;
        }

        heroController = currentCat.GetComponent<HeroController>();
        otherController = otherCat.GetComponent<HeroController>();

        SendPosition();
    }
Пример #38
0
    // Use this for initialization
    void Start()
    {
        this.HeroControllerOne = HeroOne.GetComponent<HeroController>();
        this.HeroControllerTwo = HeroTwo.GetComponent<HeroController>();
        this.HeroControllerThree = HeroThree.GetComponent<HeroController>();
        nextShotOne = nextShotTwo = nextShotThree = shotTime;
        bigLaserTime = bigLaserCooldown;
        chargeTime1 = 0;
        chargeTime2 = 0;
        chargeTime3 = 0;

        if(InputManager.Devices.Count == 2)
        {
            HeroControllerTwo = HeroControllerOne;
            HeroControllerThree = HeroControllerOne;
        }
        if (InputManager.Devices.Count == 3)
        {
            HeroControllerThree = HeroControllerOne;
        }
    }
Пример #39
0
	void Start()
	{
		//_ancestor = FindObjectOfType<Ancestor>();
		foreach(Ancestor ancestor in FindObjectsOfType<Ancestor>())
		{
			if (ancestor._isPlayer==true)
			{
				_ancestor = ancestor;
			}
		}
		_ancestor.PassUI(this);
		_hero = FindObjectOfType<HeroController>();
		_hero.PassUI(this);
		_enemy = FindObjectOfType<EnemyController>();
		_enemy.PassUI(this);
		_enemyManager = FindObjectOfType<EnemyManager>();
		_enemyManager.PassUI(this);

		VictoryScreen.SetActive (false);
		LossScreen.SetActive (false);
		
		//_intervalIndicator.value = 0;
		_heroHealth.value = 1;
		_enemyHealth.value = 1;
		
		_playerIcon.transform.FindChild("Icon").GetComponent<UnityEngine.UI.Image>().sprite = _ancestor._ancestorIcon;
		_playerIcon.transform.FindChild("Background").GetComponent<UnityEngine.UI.Image>().sprite = _ancestor._ancestorBg;
		_button1.transform.FindChild("Icon").GetComponent<UnityEngine.UI.Image>().sprite = _ancestor._action1._actionIcon;
		_button1.transform.FindChild("Background").GetComponent<UnityEngine.UI.Image>().sprite = _ancestor._ancestorBg;
		_button2.transform.FindChild("Icon").GetComponent<UnityEngine.UI.Image>().sprite = _ancestor._action2._actionIcon;
		_button2.transform.FindChild("Background").GetComponent<UnityEngine.UI.Image>().sprite = _ancestor._ancestorBg;
		_button3.transform.FindChild("Icon").GetComponent<UnityEngine.UI.Image>().sprite = _ancestor._action3._actionIcon;
		_button3.transform.FindChild("Background").GetComponent<UnityEngine.UI.Image>().sprite = _ancestor._ancestorBg;
		ExitButton.transform.FindChild("Background").GetComponent<UnityEngine.UI.Image>().sprite = _ancestor._ancestorBg;



	}
Пример #40
0
 void Start()
 {
     this.HeroController = this.GetComponent<HeroController>();
     //this.GetComponentInChildren<SpriteRenderer>().sprite = this.BodySprites[this.HeroController.PlayerNumber];
     //this.ProjectileSprite = this.ProjectileSprites[this.HeroController.PlayerNumber];
     //this.ProjectileExplosionSprite = this.ProjectileExplosions[this.HeroController.PlayerNumber];
     this.StartScale = this.scale;
     this.StartWidth = this.GetComponent<Collider2D>().bounds.size.x;
     this.RespawnTimeCalculated = this.RespawnTime;
     OriginalMaxSpeed = MaxNewSpeed;
     health = maxHealth;
     this.groundMask = LayerMask.NameToLayer ("Ground");
 }
Пример #41
0
    void Start()
    {
        //Debug.Log (Application.loadedLevelName);

        if(Application.loadedLevelName!="Level_Shop")
            player = GameObject.FindGameObjectWithTag ("Player").GetComponent<HeroController> ();
        cameracontrol = GameObject.FindGameObjectWithTag ("MainCamera").GetComponent <camerafollowing > ();
        if (player != null&&!IsLevel )
                        player.enabled = false;
        if (!IsLevel && cameracontrol != null)
        {
            cameracontrol.enabled=false;
        }
        if(Application.loadedLevelName =="Level_Shop")
            s = GameObject.Find ("Shop").GetComponent<Shop> ();
        if (Application.loadedLevelName == "Level_Hospital")
            H = GameObject.Find ("Shop").GetComponent<Hospital > ();
        AudioListener.volume = .3f;
        MenuScript.Volume = AudioListener.volume;
        if (!IsLevel)
            IsOpen = true;
        if (IsLevel)
        {
            if(Application.loadedLevelName!="Level_Shop"&&select1)
                Save (1);
            else if(Application.loadedLevelName!="Level_Shop"&&select2)
                Save (2);
            else if(Application.loadedLevelName!="Level_Shop"&&select3)
                Save (3);
            else if(Application.loadedLevelName!="Level_Shop"&&select4)
                Save (4);

        }
        Time.timeScale = gameSpeed;
    }
Пример #42
0
    void Start()
    {
        this.ThresholdModifier = this.DefaultThresholdModifier;
        this.scalarAccelerationModifier = this.defaultScalarAccelerationModifier;
        this.HeroController = this.GetComponent<HeroController>();
        this.GetComponentInChildren<SpriteRenderer>().sprite = this.BodySprites
            [((this.HeroController.PlayerNumber == (CurrentWinnerIndex - 1)) ? this.BodySprites.Length - 1: this.HeroController.PlayerNumber)];
        this.ProjectileSprite = this.ProjectileSprites[this.HeroController.PlayerNumber];
        this.ProjectileExplosionSprite = this.ProjectileExplosions[0];
        this.RespawnTimeCalculated = this.RespawnTime;

        this.groundMask = LayerMask.NameToLayer ("Ground");
        this.IsAlive = true;
        if(this.PlayerIndex==1){
            previousRotation = 90.0f;
        }
        if(this.PlayerIndex==2){
            previousRotation = 180.0f;
        }
        if(this.PlayerIndex==3){
            previousRotation = 270.0f;
        }
        if(this.PlayerIndex==4){
            previousRotation = 0.0f;
        }
    }
Пример #43
0
 // Use this for initialization
 public void Start()
 {
     _controller = GetComponent<HeroController>();
     _rigidbody2D = GetComponent<Rigidbody2D>();
 }
Пример #44
0
 public HeroOrder(HeroController destination, DTRMVector2 targetPosition)
     : base(destination)
 {
     orderType = HeroOrderType.Move;
     this.targetPosition = targetPosition;
 }
Пример #45
0
 public HeroOrder(HeroController destination, Health targetVictim)
     : base(destination)
 {
     orderType = HeroOrderType.Attack;
     this.targetVictim = targetVictim;
 }
Пример #46
0
 // Use this for initialization
 void Start()
 {
     controller = GetComponent<HeroController>();
 }
Пример #47
0
 void Awake()
 {
     this.interactionEnabled = false;
     this.sprite = this.gameObject.GetComponent<tk2dSprite>();
     this.heroController = this.gameObject.GetComponent<HeroController>();
 }
Пример #48
0
 // Use this for initialization
 void Start()
 {
     this.HeroController = this.GetComponent<HeroController>();
 }
Пример #49
0
 // Use this for initialization
 void Start()
 {
     CharacterController characterController = target.GetComponent<CharacterController>();
     if(characterController)
     {
         centerOffset = characterController.bounds.center - target.position;
         headOffset = centerOffset;
         headOffset.y = characterController.bounds.max.y - target.position.y;
     }
     if(target)
     {
         controller = target.GetComponent<HeroController>();
     }
     if(!controller)
     {
         Debug.Log("Please assign a target to the camera that has a Hero Controller script component.");
     }
     var angles = transform.eulerAngles;
     x = angles.y;
     y = angles.x;
 }
Пример #50
0
    public override void Start()
    {
        base.Start();

        controller = new HeroController( this );
    }
Пример #51
0
 // Use this for initialization
 void Start()
 {
     player = GameObject.FindGameObjectWithTag ("Player").GetComponent<HeroController>();
 }
Пример #52
0
 // Use this for initialization
 void Start()
 {
     //BossHealth = 3;
     meteor = GameObject.FindGameObjectWithTag("Meteor").GetComponent<Meteor>();
     playerObj = GameObject.FindGameObjectWithTag("Player");
     player = GameObject.FindGameObjectWithTag("Player").GetComponent<HeroController>();
     dead = false;
 }
Пример #53
0
 // Use this for initialization
 void Start()
 {
     player = new VitalsScript ();
     playerController = gameObject.GetComponent<HeroController> ();
     particle =GameObject.FindGameObjectWithTag ("Player"). GetComponent<ParticleSystem > ();
 }
Пример #54
0
 // Use this for initialization
 void Start()
 {
     anim = GetComponentInParent<Animator> ();
     player = GameObject.FindGameObjectWithTag("Player");
     upperFlare = GameObject.Find ("Upper Flare");
     lowerFlare = GameObject.Find ("Lower Flare");
     drill = GameObject.Find ("Drill");
     heroController = player.GetComponent<HeroController>();
     upperFlareRender = upperFlare.GetComponent<SpriteRenderer> ();
     lowerFlareRender = lowerFlare.GetComponent<SpriteRenderer> ();
     drillRender = drill.GetComponent<SpriteRenderer> ();
     ArrowLeftCount = 0;
     ArrowRightCount = 0;
     HeroStartCharge=false;
     success = false;
     anim.SetBool ("Charge", false);
     anim.SetBool ("Drill", false);
 }
Пример #55
0
    void Start()
    {
        this.DustCollected = 0;
        this.HeroController = this.GetComponent<HeroController>();
        this.StartScale = this.scale;
        this.StartWidth = this.GetComponent<Collider2D>().bounds.size.x;

        this.groundMask = LayerMask.NameToLayer("Ground");
    }
Пример #56
0
 void Start()
 {
     _hero = GameObject.Find ("Hero").GetComponent<HeroController> ();
 }
Пример #57
0
 void Awake()
 {
     this.heroController = this.gameObject.GetComponent<HeroController>();
 }
Пример #58
0
	public void RegisterWithControllers()
	{
		Debug.Log("RegisterWithControllers()");
		m_currentCombatController = FindObjectOfType<CombatController>();
		Debug.Log (m_currentCombatController);
		m_currentHeroController = FindObjectOfType<HeroController> ();

		if (m_currentCombatController == null || m_currentHeroController == null) {
			Debug.LogWarning ("No Hero and/or CombatController found!");
		}
		else
		{
			m_currentCombatController._ancestorList.Add ( this );
			m_currentHeroController._ancestorList.Add ( this );
		}
	}
Пример #59
0
 // Use this for initialization
 void Start()
 {
     meteor = GameObject.FindGameObjectWithTag("Meteor").GetComponent<Meteor>();
     playerObj = GameObject.FindGameObjectWithTag("Player");
     player = GameObject.FindGameObjectWithTag("Player").GetComponent<HeroController>();
     dead = false;
     rigidbody2D.velocity = new Vector3(0, -10f, 0);
 }
Пример #60
0
 // Use this for initialization
 void Start()
 {
     if(target)
     {
         controller = target.GetComponent<HeroController>();
     }
     if(!controller)
     {
         Debug.Log("Please assign a target to the camera that has a Hero Controller script component.");
     }
 }