Example #1
0
 private void OnEnable()
 {
     if (slot == null)
     {
         slot = GetComponent <EnergyDeviceSlot>();
     }
 }
 private void OnEnable()
 {
     if (slot == null)
     {
         slot = GetComponent <EnergyDeviceSlot>();
     }
     if (grid == null)
     {
         grid = GetComponentInChildren <GridRenderer>();
     }
     if (meter == null)
     {
         meter = GetComponentInChildren <EnergyAccumulatorMeter>();
     }
 }
    private Vector3 GetRandomPositionOverSlot(EnergyDeviceSlot slot, float yOffset)
    {
        var device = slot.attachedDevices[Random.Range(0, slot.attachedDevices.Count)];

        return(GetRandomPositionInGrid(device, yOffset));
    }