/// Simple calculation for debugging Vector3 GetPlacementPosition(UIPlacement placement) { // ERROR: moves neuron after one frame var anchor = placement.location.anchoredPosition; return(new Vector3(anchor.x, anchor.y, 0f)); }
void Awake() { gameManager = GameObject.Find("GameManager").GetComponent <GameManager>(); prefabManager = GameObject.Find("PrefabManager").GetComponent <PrefabManager>(); uiManager = GameObject.Find("UIManager").GetComponent <UIPlacement>(); inventoryManager = GameObject.Find("InventoryManager").GetComponent <InventoryManager>(); characterManager = GameObject.Find("CharacterManager").GetComponent <CharacterManager>(); }
Vector3 GetRadialOffsetPosition(Neuron neuron, UIPlacement icon) { Vector3 iconPosition = icon.location.localPosition; // * WPP: where do 3 and -16 come from? If settings, expose values in inspector; // if mathematical constants, declare as constants, if based on something else, include calculation. float radialDistance = (neuron.index % 3 - GetModuloOffset(neuron.io)) * -16f; Vector2 clockHand = iconPosition.normalized; Vector3 newPos = iconPosition; Vector2 offset = clockHand * radialDistance; newPos.x += offset.x; newPos.y += offset.y; return(newPos / halfPanelSize + Random.insideUnitSphere * randomOffset); }
void Awake() { objectives = GameObject.Find("Objectives").GetComponent <ObjectivesList>(); uiManager = GameObject.Find("UIManager").GetComponent <UIPlacement>(); //DontDestroyOnLoad(this.gameObject); }