// Use for early initialization
    private void Awake()
    {
        GameObject parent = transform.parent.gameObject;

        sprite_renderer   = parent.GetComponent <SpriteRenderer>();
        platform_collider = parent.GetComponent <BoxCollider2D>();
        background_object = parent.transform.Find("Background").gameObject;

        // Validate
        if (!TriggerBuildValidator.Validate(this.gameObject))
        {
            Destroy(this);
        }
        #if UNITY_EDITOR
        if (sprite_renderer == null)
        {
            Debug.LogError("Invalid configuration for crumbling platform: missing sprite renderer.");
        }
        if (platform_collider == null)
        {
            Debug.LogError("Invalid configuration for crumbling platform: missing box collider 2D.");
        }
        if (background_object == null)
        {
            Debug.LogError("Invalid configuration for crumbling platform: missing background.");
        }
        #endif
    }
예제 #2
0
 // Use this for initialization
 void Start()
 {
     if (!TriggerBuildValidator.Validate(this.gameObject))
     {
         Destroy(this);
     }
 }
예제 #3
0
    // Use this for initialization
    void Start()
    {
        if (!TriggerBuildValidator.Validate(this.gameObject))
        {
            Destroy(this);
            return;
        }
        char_stats = Referencer.instance.player.GetComponent <CharacterStats>();

        Initialize();
    }
예제 #4
0
    // Use this for initialization
    void Start()
    {
        if (!TriggerBuildValidator.Validate(this.gameObject))
        {
            return;
        }

        // Can't just do a radius test b/c that would be center-center. We want to hit if a foot or arm gets hit, too.
        CircleCollider2D circle_collider = GetComponent <CircleCollider2D>();

        circle_collider.radius = radius;
    }
예제 #5
0
    // Use this for initialization
    void Start()
    {
        // Validate the build.
        if (!TriggerBuildValidator.Validate(this.gameObject))
        {
            Destroy(this);
            return;
        }

        platform_path = GetComponentInParent <FollowPath>(); //TODO: arc path support?
        if (platform_path == null)
        {
            #if UNITY_EDITOR
            Debug.LogError("Lift configuration issue: lift is not a moving platform");
            #endif
        }
    }