示例#1
0
    public void Awake()
    {
        this._core = GameObject.Find("Core").GetComponent <CoreController>();

        // Collisions
        this._colliders = new List <Collider2D>();

        // Set material
        this._paradoxMaterial = GetComponent <util_material>();
        this._paradoxMaterial.setMaterial(new Material(Shader.Find("Paradox_outline_shader")));

        // Setup RESET
        this._reset = GetComponent <util_resetable>();
        this._reset.saveObject();

        // Set default movement
        this._body          = GetComponent <Rigidbody2D>();
        this._body.bodyType = RigidbodyType2D.Kinematic;
        this._body.useFullKinematicContacts = true;

        // Setup drag util
        this.drag = ScriptableObject.CreateInstance <util_drag>();
        this.drag.setup(this._body);

        // SETUP game object
        this.tag = "paradox_object";
        this.gameObject.layer = 11;

        this.setMaterialColor(this._defaultColor);
    }
示例#2
0
    public void Awake()
    {
        this._body = GetComponent <Rigidbody2D>();

        // Setup reset
        this._reset = GetComponent <util_resetable>();
        this._reset.saveObject();

        // Disable movement by default
        this._body.bodyType = RigidbodyType2D.Static;

        // SETUP
        this.tag = "timed_object";
        this.gameObject.layer = 10;
    }
示例#3
0
    public void Awake()
    {
        this._core = GameObject.Find("Core").GetComponent <CoreController>();

        this._colliders           = new List <Collider2D>();
        this._enabledStickingTags = new List <string>()
        {
            "static_object",
            "paradox_object",
            "timed_object"
        };

        this._tape      = this.transform.GetChild(0).GetComponent <SpriteRenderer>();
        this._ducktape  = this.GetComponent <SpriteRenderer>();
        this._collision = this.GetComponent <CircleCollider2D>();

        // Setup reset
        this._reset = this.GetComponent <util_resetable>();
        this._reset.saveObject();

        // SETUP BODY
        this._body          = GetComponent <Rigidbody2D>();
        this._body.bodyType = RigidbodyType2D.Kinematic;
        this._body.useFullKinematicContacts = true;

        // SETUP DRAG
        this._drag = ScriptableObject.CreateInstance <util_drag>();
        this._drag.setup(this._body);

        // Set material
        this._paradoxMaterial = GetComponent <util_material>();
        this._paradoxMaterial.setMaterial(new Material(Shader.Find("Paradox_outline_shader")));

        // Setup object
        this.tag = "ducktape_object";
        this.gameObject.layer = 11;

        // Create glue for static objects
        this.createTempGlue();
        this.displayTape(false); // Hide tape

        this.setMaterialColor(this._defaultColor);
    }