Exemple #1
0
        private void OnSelectUnit(GameObject go)
        {
            UnitData dataOfClass = DataSource.FindDataOfClass <UnitData>(go, (UnitData)null);

            if (dataOfClass == null)
            {
                return;
            }
            if (this.OnUnitSelect != null)
            {
                this.OnUnitSelect(dataOfClass.UniqueID);
            }
            else
            {
                GlobalVars.SelectedUnitUniqueID.Set(dataOfClass.UniqueID);
                GlobalVars.SelectedUnitJobIndex.Set(dataOfClass.JobIndex);
                FlowNode_DownloadAssets component = (FlowNode_DownloadAssets)((Component)this).GetComponent <FlowNode_DownloadAssets>();
                if (Object.op_Inequality((Object)component, (Object)null))
                {
                    component.DownloadUnits = new string[1]
                    {
                        GlobalVars.UnlockUnitID
                    }
                }
                ;
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 1);
            }
        }
Exemple #2
0
        public void OnHoldIcon(GameObject go)
        {
            UnitParam dataOfClass = DataSource.FindDataOfClass <UnitParam>(go, (UnitParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            GlobalVars.UnlockUnitID = dataOfClass.iname;
            FlowNode_DownloadAssets component = (FlowNode_DownloadAssets)((Component)this).GetComponent <FlowNode_DownloadAssets>();

            if (Object.op_Inequality((Object)component, (Object)null))
            {
                component.DownloadUnits = new string[1]
                {
                    GlobalVars.UnlockUnitID
                }
            }
            ;
            FlowNode_GameObject.ActivateOutputLinks((Component)this, 10);
        }