예제 #1
0
    public static void displayIndicator(GameObject obj)
    {
        Vector3    rayStart = obj.transform.position + new Vector3(0, 80f, 0);
        RaycastHit hit;

        Physics.Raycast(rayStart, Vector3.down, out hit, 80f);

        var   part      = GameObject.Instantiate(ParticleHelper.getInstance().salvageParticles, hit.point, Quaternion.identity, obj.transform);
        float totalTime = obj.GetComponent <Structure>().getHP().HP;

        totalTime /= 2.5f;
        Debug.Log("Total time of salvage particle: " + totalTime);
        part.GetComponent <ParticleUVOffset>().totalTime = totalTime;
    }
예제 #2
0
    public new void handleDeserialization(SaveLoad.SerializationInfo info)
    {
        serializationData data = (serializationData)info;

        this.storedEnergy = data.storedEnergy;
        this.busy         = data.busy;
        this.ownResource  = data.ownResource;
        this.salvaging    = data.salvaging;
        this.curTarget    = data.target;

        if (salvaging)
        {
            Debug.Log("got salvaging info, creating particles....");
            //TODO, this gets called before terrain scripts are loaded
            GameObject.Instantiate(ParticleHelper.getInstance().salvageParticles, this.gameObject.transform);
        }

        //reloadConnections();
    }
예제 #3
0
    public new void handleDeserialization(SaveLoad.SerializationInfo info)
    {
        serializationData data = (serializationData)info;

        this.storedEnergy = data.storedEnergy;
        this.busy         = data.busy;
        this.ownResource  = data.ownResource;
        this.salvaging    = data.salvaging;
        if (this.busy)
        {
            DeliveryRoutes.addRoute(this.gameObject, DeliveryRoutes.getClosest("dropBase", this.gameObject).gameObject, ressources.Trees);
        }

        if (salvaging)
        {
            GameObject.Instantiate(ParticleHelper.getInstance().salvageParticles, this.gameObject.transform);
        }

        //reloadConnections();
    }