Esempio n. 1
0
        public int GetStateIcon(StateIcon icon)
        {
            // For now we use the same image list for both; the first few icons are just reused
            // Our api allows us to change this later on
            SpecialIcon si;

            switch (icon)
            {
            case StateIcon.Blank:
                si = SpecialIcon.Blank;
                break;

            case StateIcon.Incoming:
                si = SpecialIcon.Incoming;
                break;

            case StateIcon.Outgoing:
                si = SpecialIcon.Outgoing;
                break;

            case StateIcon.Collision:
                si = SpecialIcon.Collision;
                break;

            default:
                throw new ArgumentOutOfRangeException("icon", icon, "Icon out of range");
            }

            return(GetSpecialIcon(si));
        }
        void ReleaseDesignerOutlets()
        {
            if (CommentField != null)
            {
                CommentField.Dispose();
                CommentField = null;
            }

            if (ConfirmButton != null)
            {
                ConfirmButton.Dispose();
                ConfirmButton = null;
            }

            if (InventoryIDLabel != null)
            {
                InventoryIDLabel.Dispose();
                InventoryIDLabel = null;
            }

            if (RejectButton != null)
            {
                RejectButton.Dispose();
                RejectButton = null;
            }

            if (StateCommentLabel != null)
            {
                StateCommentLabel.Dispose();
                StateCommentLabel = null;
            }

            if (StateIcon != null)
            {
                StateIcon.Dispose();
                StateIcon = null;
            }

            if (StateTimeStartLabel != null)
            {
                StateTimeStartLabel.Dispose();
                StateTimeStartLabel = null;
            }

            if (StateUserLabel != null)
            {
                StateUserLabel.Dispose();
                StateUserLabel = null;
            }
        }
Esempio n. 3
0
 public override void Dispose()
 {
     if (HealthBar != null)
     {
         HealthBar.Dispose();
     }
     if (StateIcon != null)
     {
         StateIcon.Dispose();
     }
     if (TimeIcon != null)
     {
         TimeIcon.Dispose();
     }
     base.Dispose();
 }
Esempio n. 4
0
    public void Init()
    {
        if (!enabled)
        {
            return;
        }
        stateIcon = GetComponentInChildren <StateIcon>();
        stateIcon.Init();
        navigator = GetComponent <Navigator>();
        navigator.Init();

        health     = new Health();
        rifle      = GetComponentInChildren <Rifle>();
        enemySight = GetComponent <EnemySight>();

        enemySight.SetOnPlayerSightedListener(() => {
            if (personality != null)
            {
                personality.OnPlayerSeen(Player.Instance.transform.position);
            }
        });
        sosSprite = Resources.Load <Sprite>("StateIcons\\sos");
        ChoosePersonality();
    }
Esempio n. 5
0
 public void UpdateStateBar(EntityStats owner)
 {
     for (int i = 0; i < iconContainer.childCount; i++)
     {
         iconContainer.GetChild(i).gameObject.SetActive(false);
     }
     if (owner.states == null && owner.states.Count <= 0)
     {
         return;
     }
     for (int i = 0; i < owner.states.Count; i++)
     {
         for (int y = 0; y < owner.states[i].stackAmount; y++)
         {
             if (owner.states[i].currentState.stateIcon == null)
             {
                 continue;
             }
             StateIcon ic = iconPooler.SpawnTargetObject(iconPrefab, 10, iconContainer).GetComponent <StateIcon>();
             //ic.transform.parent = iconContainer;
             ic.SetUpIcon(owner.states[i].currentState.stateIcon);
         }
     }
 }
Esempio n. 6
0
        public int GetStateIcon(StateIcon icon)
        {
            // For now we use the same image list for both; the first few icons are just reused
            // Our api allows us to change this later on
            SpecialIcon si;
            switch (icon)
            {
                case StateIcon.Blank:
                    si = SpecialIcon.Blank;
                    break;
                case StateIcon.Incoming:
                    si = SpecialIcon.Incoming;
                    break;
                case StateIcon.Outgoing:
                    si = SpecialIcon.Outgoing;
                    break;
                case StateIcon.Collision:
                    si = SpecialIcon.Collision;
                    break;
                default:
                    throw new ArgumentOutOfRangeException("icon", icon, "Icon out of range");
            }

            return GetSpecialIcon(si);
        }