示例#1
0
        public void RefreshAllCreatures()
        {
            foreach (GameObject creatureObj in this.fieldObjectsRoot.gameObject.FindChildrenByName("creature_"))
            {
                UICreature creatureCom = creatureObj.GetComponent <UICreature>();
                if (creatureCom == null)
                {
                    continue;
                }

                creatureCom.SetHasActioned(false);
            }
        }
示例#2
0
        public void RefreshCreature(FDCreature creature)
        {
            if (creature == null)
            {
                throw new ArgumentNullException("creature");
            }

            UICreature uiCreature = GetUICreature(creature.CreatureId);

            if (uiCreature == null)
            {
                Debug.LogError("Cannot find creature on UI: creatureId = " + creature.CreatureId);
                return;
            }

            // Update position
            uiCreature.transform.localPosition = FieldTransform.GetCreaturePixelPosition(creature.Position);


            // Update status
            uiCreature.SetHasActioned(creature.HasActioned);
        }