//add SlotScript // Use this for initialization void Start() { if (Net = FindObjectOfType <NetConnection>()) { Net.transform.SetParent(FindObjectOfType <Canvas>().transform); ////Net.Sender("ARRRRRRR"); Net.gameObject.SetActive(true); Debug.Log(Net); ObserverMode = Net.observerMode; } builderInterface = FindObjectOfType <BuilderInterface>(); telega = FindObjectOfType <TelegaManager>(); FanucSettingsPanel = FindObjectOfType <CommandFanucUI>(); FanucSettingsPanel.gameObject.SetActive(false); CameraSettingsPanel = FindObjectOfType <CommandCameraUI>(); CameraSettingsPanel.gameObject.SetActive(false); TelegaSettingsPanel = FindObjectOfType <CommandTelegaUI>(); TelegaSettingsPanel.gameObject.SetActive(false); avalaibleCommands = FindObjectOfType <AvailableCommands>(); Pull = FindObjectOfType <PullManager>(); ScenarioEditor = GameObject.Find("ScenarioEditor"); ScenarioEditor.SetActive(false); dropdownSceneObjects = FindObjectOfType <DropdownSceneObjects>(); dropdownSceneObjects.gameObject.SetActive(false); fanuc = FindObjectOfType <FanucScript>(); SceneSynchronization = FindObjectOfType <InstantiateFromCam>(); telega.telega.Type = telegaScript.MoveType.RotateBarsAndMove; if (ObserverMode) { CloseAllUI(); UserControlLock = true; fanuc.mode = 0; telega.telega.Type = telegaScript.MoveType.RotateBarsAndMove; } }
// Use this for initialization protected virtual void Awake() { _key_shoot_sound = -1; _soundManager = SoundManager.Instance; _camera = transform.FindChild("Camera"); _base = transform.FindChild("Base"); _tourelle = _base.FindChild("Tourelle"); _head = _tourelle.FindChild("Head"); if (_head != null) _cannon = _head.FindChild("Cannon"); else _cannon = _tourelle.FindChild("Cannon"); if (_cannon != null) _shoot = _cannon.FindChild("Shoot"); Transform p = _tourelle.FindChild("Particle"); if (p == null && _head != null) p = _head.FindChild("Particle"); if (p == null && _cannon != null) p = _cannon.FindChild("Particle"); if(p != null) { _particle = p.GetComponent<ParticleSystem>(); Transform tmp = p.FindChild("Smoke"); if(tmp != null) _smoke = tmp.GetComponent<ParticleSystem>(); tmp = p.FindChild("Sparks"); if(tmp != null) _sparkles = p.FindChild("Sparks").GetComponent<ParticleSystem>(); } watcher = _base.GetComponent<EnemyWatcher>(); if(watcher != null) { watcher.Init(this, Range); } Transform c = transform.FindChild("Canvas"); if(c != null) _canvas = c.gameObject; _direction = new Vector3(); _angleRotation = 0f; _fire = false; _allowFire = true; Auto = true; Level = 1; _targets = new ArrayList(); FireRate = Mathf.Abs(FireRate); if (FireRate == 0f) FireRate = 1f; if (Bullet != null && BulletsSize > 0) { _bullets = ScriptableObject.CreateInstance<PullManager>(); _bullets.Init(Bullet, BulletsSize); } else _bullets = null; if (Node != null && NodesSize > 0) { _nodes = ScriptableObject.CreateInstance<PullManager>(); _nodes.Init(Node, NodesSize); } else _nodes = null; EmitParticle(false); Move(); }