Beispiel #1
0
    private Vector3 GetPlatformExtents(GameObject platform)
    {
        Vector3        extents;
        PlatformMotion motion = platform.GetComponent <PlatformMotion>();

        if (motion != null)
        {
            extents = motion.GetMotionExtents();
        }
        else
        {
            extents = platform.transform.lossyScale;
        }
        return(extents);
    }
Beispiel #2
0
    //setting inner placeholder
    private void SetPlaceholderTransform(GameObject platform, GameObject placeholder)
    {
        Transform      placeholderTransform = placeholder.transform;
        PlatformMotion motion = platform.GetComponent <PlatformMotion>();

        if (motion != null)
        {
            placeholderTransform.position   = motion.GetMotionCenter();
            placeholderTransform.localScale = motion.GetMotionExtents();
        }
        else
        {
            placeholderTransform.position   = platform.transform.position;
            placeholderTransform.localScale = platform.transform.localScale;
        }
    }