void Start() { //lineR = GetComponentInChildren<LineRenderer>(); //lineR.gameObject.SetActive(false); curNumOfConnections = 0; connect_manager = Connection_Manager.instance; // Add this Pole Handler to the Connection Manager connect_manager.AddNewPoleHandler(gridPosX, this); world = World_Generator.instance; mouse = Mouse_Controller.instance; myPole = world.GetPoleAtLocationX(gridPosX); if (myPole == null) { Debug.LogError("Couldnt find my Pole!"); } if (myPole != null) { maxConnections = myPole.maxConnections; } }
void Awake() { rigidId = GetComponent <Rigidbody2D>(); spriteId = GetComponent <SpriteRenderer>(); aniController = GetComponent <Animator>(); mouseDash = GetComponent <Mouse_Controller>(); }
private void Start() { if (_Instance != null) { Debug.Log("Err there are 2 instances of Mouse Controllers"); Destroy(this); } else { _Instance = this; DontDestroyOnLoad(this.gameObject); } //MainBase(); }
void Awake() { // Get the Sprite Renderer to be able to change the Sprite's color depending on position sr = GetComponent<SpriteRenderer> (); // Clear red color for Invalid Position invalidPosColor = new Color(1, 0, 0, 0.5f); // Clear green color for Valid Position trueColor = new Color(0, 1, 0, 0.5f); // Begin as clear Color sr.color = Color.clear; // Set posY transform to this tile's Spawn Position (passed in by Discover Tile) transform.position = spawnPos; resourceGrid = ResourceGrid.Grid; objPool = ObjectPool.instance; build_controller = Build_MainController.Instance; mouse_controller = Mouse_Controller.MouseController; }