Beispiel #1
0
    internal float newY;                // Desired height of the arena; internal so the Lua Arena object may refer to it (lazy)

    /// <summary>
    /// Initialization.
    /// </summary>
    private void Awake()
    {
        // unlike the player we really dont want this on two components at the same time
        if (instance != null)
        {
            throw new InvalidOperationException("Currently, the ArenaSizer may only be attached to one object.");
        }

        outer     = GameObject.Find("arena_border_outer").GetComponent <RectTransform>();
        inner     = GameObject.Find("arena").GetComponent <RectTransform>();
        newX      = currentX;
        newY      = currentY;
        instance  = this;
        luaStatus = new LuaArenaStatus();
    }
Beispiel #2
0
    /// <summary>
    /// Initialization.
    /// </summary>
    private void Awake()
    {
        // unlike the player we really dont want this on two components at the same time
        if (instance != null)
        {
            throw new CYFException("Currently, the ArenaManager may only be attached to one object.");
        }

        inner = GameObject.Find("arena").GetComponent <RectTransform>();
        outer = inner.parent.GetComponent <RectTransform>();

        /*outer = GameObject.Find("arena_border_outer").GetComponent<RectTransform>();
         * inner = GameObject.Find("arena").GetComponent<RectTransform>();*/
        newWidth  = currentWidth;
        newHeight = currentHeight;
        instance  = this;
        luaStatus = new LuaArenaStatus();
    }