Exemple #1
0
        public void UpdateMultipleAttackTasks(FactionEntity sourceEntity, MultipleAttackManager multipleAttackComp)
        {
            if (multipleAttackComp == null)
            {
                return;
            }

            for (int attackID = 0; attackID < multipleAttackComp.AttackEntities.Length; attackID++) //go through all the attack entities
            {
                AttackEntity attackComp = multipleAttackComp.AttackEntities[attackID];
                if (!attackComp.IsLocked && !attackComp.IsActive()) //as long as the attack entity is not active and not locked, show a task to activate it:
                {
                    TaskUI taskUI = Add(new TaskUIAttributes
                    {
                        ID     = attackID,
                        type   = TaskTypes.attackTypeSelection,
                        icon   = attackComp.GetIcon(),
                        source = sourceEntity
                    }, multipleAttackComp.GetTaskPanelCategory());

                    if (attackComp.CoolDownActive == true) //if the attack type is in cool down mode
                    {
                        Color nextColor = taskUI.GetComponent <Image>().color;
                        nextColor.a = 0.5f; //make it semi-transparent to indicate cooldown to player
                        taskUI.GetComponent <Image>().color = nextColor;
                    }
                }
            }
        }